<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GObject Oriented Panel Plugin Registers Macros: xfce4-panel Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="xfce4-panel Reference Manual">
<link rel="up" href="libxfce4panel-plugins.html" title="Part II. Panel Plugins">
<link rel="prev" href="libxfce4panel-Panel-Plugin-Register-Macros.html" title="Panel Plugin Register Macros">
<link rel="next" href="libxfce4panel-widgets.html" title="Part III. Additional Widgets">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts">
<a href="#" class="shortcut">Top</a><span id="nav_description">  <span class="dim">|</span> 
                  <a href="#libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.description" class="shortcut">Description</a></span>
</td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="libxfce4panel-plugins.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="libxfce4panel-Panel-Plugin-Register-Macros.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="libxfce4panel-widgets.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.top_of_page"></a>GObject Oriented Panel Plugin Registers Macros</span></h2>
<p>GObject Oriented Panel Plugin Registers Macros — Macros to register panel plugins, written as GObjects.</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.functions"></a><h2>Functions</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="functions_proto_type">
<col class="functions_proto_name">
</colgroup>
<tbody>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PLUGIN:CAPS" title="XFCE_PANEL_DEFINE_PLUGIN()">XFCE_PANEL_DEFINE_PLUGIN</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PLUGIN-RESIDENT:CAPS" title="XFCE_PANEL_DEFINE_PLUGIN_RESIDENT()">XFCE_PANEL_DEFINE_PLUGIN_RESIDENT</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-TYPE:CAPS" title="XFCE_PANEL_DEFINE_TYPE()">XFCE_PANEL_DEFINE_TYPE</a><span class="c_punctuation">()</span>
</td>
</tr>
<tr>
<td class="define_keyword">#define</td>
<td class="function_name">
<a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PREINIT-FUNC:CAPS" title="XFCE_PANEL_DEFINE_PREINIT_FUNC()">XFCE_PANEL_DEFINE_PREINIT_FUNC</a><span class="c_punctuation">()</span>
</td>
</tr>
</tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.other"></a><h2>Types and Values</h2>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="other_proto_type">
<col class="other_proto_name">
</colgroup>
<tbody><tr>
<td class="typedef_keyword">typedef</td>
<td class="function_name"><a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XfcePanelTypeModule" title="XfcePanelTypeModule">XfcePanelTypeModule</a></td>
</tr></tbody>
</table></div>
</div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.includes"></a><h2>Includes</h2>
<pre class="synopsis">#include &lt;libxfce4panel/libxfce4panel.h&gt;
</pre>
</div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.description"></a><h2>Description</h2>
<p>Macros to register panel plugin types and custom types inside panel plugins.</p>
</div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.functions_details"></a><h2>Functions</h2>
<div class="refsect2">
<a name="XFCE-PANEL-DEFINE-PLUGIN:CAPS"></a><h3>XFCE_PANEL_DEFINE_PLUGIN()</h3>
<pre class="programlisting">#define             XFCE_PANEL_DEFINE_PLUGIN(TypeName, type_name, args...)</pre>
<p>Define a new (resident) GObject panel plugin, the parent type of the object
should be XFCE_TYPE_PANEL_PLUGIN.</p>
<div class="refsect3">
<a name="XFCE-PANEL-DEFINE-PLUGIN.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>TypeName</p></td>
<td class="parameter_description"><p>The name of the new type, in Camel case.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type_name</p></td>
<td class="parameter_description"><p>The name of the new type, in lowercase, with words separated by '_'.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>Optional list of *_register_type() function from other
objects in the plugin created with <a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-TYPE:CAPS" title="XFCE_PANEL_DEFINE_TYPE()"><span class="type">XFCE_PANEL_DEFINE_TYPE</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-DEFINE-PLUGIN-RESIDENT:CAPS"></a><h3>XFCE_PANEL_DEFINE_PLUGIN_RESIDENT()</h3>
<pre class="programlisting">#define             XFCE_PANEL_DEFINE_PLUGIN_RESIDENT(TypeName, type_name, args...)</pre>
<p>Same as <a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PLUGIN:CAPS" title="XFCE_PANEL_DEFINE_PLUGIN()"><span class="type">XFCE_PANEL_DEFINE_PLUGIN</span></a>, but if you use special libraries or objects,
it is possible the plugin will give problems when unloading the library,
a resident plugin will never be unloaded after the first load, avoiding
those issues.</p>
<div class="refsect3">
<a name="XFCE-PANEL-DEFINE-PLUGIN-RESIDENT.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>TypeName</p></td>
<td class="parameter_description"><p>The name of the new type, in Camel case.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type_name</p></td>
<td class="parameter_description"><p>The name of the new type, in lowercase, with words separated by '_'.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>...</p></td>
<td class="parameter_description"><p>Optional list of *_register_type() function from other
objects in the plugin created with <a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-TYPE:CAPS" title="XFCE_PANEL_DEFINE_TYPE()"><span class="type">XFCE_PANEL_DEFINE_TYPE</span></a>.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-DEFINE-TYPE:CAPS"></a><h3>XFCE_PANEL_DEFINE_TYPE()</h3>
<pre class="programlisting">#define             XFCE_PANEL_DEFINE_TYPE(TypeName, type_name, TYPE_PARENT)</pre>
<p>A convenient macro of <a href="/usr/share/gtk-doc/html/gobject/GTypeModule.html#G-DEFINE-DYNAMIC-TYPE:CAPS"><span class="type">G_DEFINE_DYNAMIC_TYPE</span></a> for panel plugins. Only
difference with <a href="/usr/share/gtk-doc/html/gobject/GTypeModule.html#G-DEFINE-DYNAMIC-TYPE:CAPS"><span class="type">G_DEFINE_DYNAMIC_TYPE</span></a> is that the type name send to
<a href="/usr/share/gtk-doc/html/gobject/GTypeModule.html#g-type-module-register-type"><code class="function">g_type_module_register_type()</code></a> is prefixed with "Xfce". This allows you
use use shorted structure names in the code, while the real name of the
object is a full "Xfce" name.</p>
<p>The _register_type function should be added to the args in
<a class="link" href="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.html#XFCE-PANEL-DEFINE-PLUGIN:CAPS" title="XFCE_PANEL_DEFINE_PLUGIN()"><span class="type">XFCE_PANEL_DEFINE_PLUGIN</span></a>.</p>
<div class="refsect3">
<a name="XFCE-PANEL-DEFINE-TYPE.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody>
<tr>
<td class="parameter_name"><p>TypeName</p></td>
<td class="parameter_description"><p>The name of the new type, in Camel case.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>type_name</p></td>
<td class="parameter_description"><p>The name of the new type, in lowercase, with words separated by '_'.</p></td>
<td class="parameter_annotations"> </td>
</tr>
<tr>
<td class="parameter_name"><p>TYPE_PARENT</p></td>
<td class="parameter_description"><p>The GType of the parent type.</p></td>
<td class="parameter_annotations"> </td>
</tr>
</tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
<hr>
<div class="refsect2">
<a name="XFCE-PANEL-DEFINE-PREINIT-FUNC:CAPS"></a><h3>XFCE_PANEL_DEFINE_PREINIT_FUNC()</h3>
<pre class="programlisting">#define             XFCE_PANEL_DEFINE_PREINIT_FUNC(preinit_func)</pre>
<p>Registers a pre-init function in the plugin module. This function
is called before <a href="/usr/share/gtk-doc/html/gtk3/gtk3-General.html#gtk-init"><code class="function">gtk_init()</code></a> and can be used to initialize
special libaries.
Downside of this that the plugin cannot run internal. Even if you
set X-XFCE-Interal=TRUE in the desktop file, the panel will force
the plugin to run inside a wrapper (this because the panel called
<a href="/usr/share/gtk-doc/html/gtk3/gtk3-General.html#gtk-init"><code class="function">gtk_init()</code></a> long before it starts to load the plugins).</p>
<p>Note that you can only use this once and it only works in
combination with the plugins register/define functions added
in 4.8.</p>
<div class="refsect3">
<a name="XFCE-PANEL-DEFINE-PREINIT-FUNC.parameters"></a><h4>Parameters</h4>
<div class="informaltable"><table class="informaltable" width="100%" border="0">
<colgroup>
<col width="150px" class="parameters_name">
<col class="parameters_description">
<col width="200px" class="parameters_annotations">
</colgroup>
<tbody><tr>
<td class="parameter_name"><p>preinit_func</p></td>
<td class="parameter_description"><p>name of the function that points to an
<a class="link" href="libxfce4panel-Panel-Plugin-Register-Macros.html#XfcePanelPluginPreInit" title="XfcePanelPluginPreInit ()"><span class="type">XfcePanelPluginPreInit</span></a> function.</p></td>
<td class="parameter_annotations"> </td>
</tr></tbody>
</table></div>
</div>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
</div>
<div class="refsect1">
<a name="libxfce4panel-GObject-Oriented-Panel-Plugin-Registers-Macros.other_details"></a><h2>Types and Values</h2>
<div class="refsect2">
<a name="XfcePanelTypeModule"></a><h3>XfcePanelTypeModule</h3>
<pre class="programlisting">typedef GTypeModule XfcePanelTypeModule;
</pre>
<p>Typedef for GTypeModule for possible future expansion.</p>
<p class="since">Since: <a class="link" href="api-index-4-8.html#api-index-4.8">4.8</a></p>
</div>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>